<div id="adminPage">
<h2>Edit Park</h2>
<img src="{$src}" width="230" height="150">
<br/>
<br/>
<form  action = "editpark.php" method = "post" enctype = "multipart/form-data">
	<table border = 0>
		<tr class="field">
			<td>Park picture: <input name = "pic" type = "file"></td>
			<td>
				{if $errorspic}
					{$errorspic}
				{/if}
			</td>
		</tr>
		<tr class="field">
			<td>
				<label>Park name: </label><input type = "text" name = "name" value = "{$name}"/>
			</td>
			<td>
				{if $errorsname}
					{$errorsname}
				{/if}
			</td>
		</tr>
		<tr class="field">
			<td>
				<label>Address: </label><input type = "text" name = "address" value = "{$address}"/>
			</td>
			<td>
				{if $errorsaddress}
					{$errorsaddress}
				{/if}			
			</td>
		</tr>
		<tr class="field">
			<td>
				<label>Park type: </label><input type = "text" name = "type" value = "{$type}"/>
			</td>
			<td>
				{if $errorstype}
					{$errorstype}
				{/if}
			</td>
		</tr class="field">
		<tr>
			<td>
				<label>Suburb: </label>
				<select name = "suburb">
					{if $failPC}
						<option>{$failPC}</option>
					{else}
						{section name = i loop = $optionsPC}
							{if $optionsPC[i].id eq $suburb}
								<option value = "{$optionsPC[i].id}" selected = "selected">{$optionsPC[i].suburb} ({$optionsPC[i].postcode})</option>
							{else}
								<option value = "{$optionsPC[i].id}">{$optionsPC[i].suburb} ({$optionsPC[i].postcode})</option>
							{/if}
						{/section}
					{/if}
				</select>
			</td>
		</tr>
	</table>
	<br/>
	<table>
		<tr>
			<td>Equipment</td>
			<td>Quantity</td>
		</tr>
		{if $oldEqFail}
			<tr class="field"><td>{$oldEqFail}</td></tr>
		{else}
			{section name = i loop = $equip}
				<tr class="field">
					<td>
						<input type = "checkbox" name = "park_equip[]" value = "{$equip[i].id}" 
						{if $equip[i].checked}
							checked
						{elseif $oldEq[i]}
							checked
						{/if}
						/>
						{$equip[i].name}
					</td>
					<td><input type = "text" size = "2" name = "{$equip[i].id}" 
						{if $oldEq[i]}
							value = "{$oldEq[i]}"
						{elseif $form[i]} 
							value = "{$form[i]}"
						{/if}/>
					</td>
					<td>
						{if $errors[i]}
							{$errors[i]}
						{/if}
					</td>
				</tr>
			{/section}
		{/if}
	</table>
	<br/>
	<input type = "hidden" name = "park_id" value = "{$id}">
	<input type = "submit" name = "submit" value = "Save Park"/>
	<input type = "submit" name = "submit" value = "Cancel"/>
</form>
</div>